package com.jc.ds.model;

import java.util.Date;

/**
 * jc_task
 * @author 
 */
public class JcTask extends BaseValueObject {
    private Long id;

    /**
     * 任务类型
     */
    private String taskType;

    /**
     * 业务ID 例如：订单号 SKUID 尽量用相关业务表主键
     */
    private String taskBusinessId;

    /**
     * 业务数据
     */
    private String taskData;

    /**
     * 执行结果
     */
    private String taskExeTag;

    /**
     * 当前执行次数
     */
    private Integer exeCount;

    /**
     * 最大执行次数
     */
    private Integer maxExeCount;

    /**
     * 插入时间
     */
    private Date createTime;

    /**
     * 最后更新时间
     */
    private Date lastUpdateTime;

    private String extend1;

    private String extend2;

    private String extend3;

    private String extend4;

    private String extend5;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public String getTaskBusinessId() {
        return taskBusinessId;
    }

    public void setTaskBusinessId(String taskBusinessId) {
        this.taskBusinessId = taskBusinessId;
    }

    public String getTaskData() {
        return taskData;
    }

    public void setTaskData(String taskData) {
        this.taskData = taskData;
    }

    public String getTaskExeTag() {
        return taskExeTag;
    }

    public void setTaskExeTag(String taskExeTag) {
        this.taskExeTag = taskExeTag;
    }

    public Integer getExeCount() {
        return exeCount;
    }

    public void setExeCount(Integer exeCount) {
        this.exeCount = exeCount;
    }

    public Integer getMaxExeCount() {
        return maxExeCount;
    }

    public void setMaxExeCount(Integer maxExeCount) {
        this.maxExeCount = maxExeCount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    public String getExtend1() {
        return extend1;
    }

    public void setExtend1(String extend1) {
        this.extend1 = extend1;
    }

    public String getExtend2() {
        return extend2;
    }

    public void setExtend2(String extend2) {
        this.extend2 = extend2;
    }

    public String getExtend3() {
        return extend3;
    }

    public void setExtend3(String extend3) {
        this.extend3 = extend3;
    }

    public String getExtend4() {
        return extend4;
    }

    public void setExtend4(String extend4) {
        this.extend4 = extend4;
    }

    public String getExtend5() {
        return extend5;
    }

    public void setExtend5(String extend5) {
        this.extend5 = extend5;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByTaskType(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by task_type asc";
            }else{
                this.orderStr = this.orderStr + ",task_type asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by task_type desc";
            }else{
                this.orderStr = this.orderStr + ",task_type desc";
            }
        }
    }

    public void orderByTaskBusinessId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by task_business_id asc";
            }else{
                this.orderStr = this.orderStr + ",task_business_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by task_business_id desc";
            }else{
                this.orderStr = this.orderStr + ",task_business_id desc";
            }
        }
    }

    public void orderByTaskData(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by task_data asc";
            }else{
                this.orderStr = this.orderStr + ",task_data asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by task_data desc";
            }else{
                this.orderStr = this.orderStr + ",task_data desc";
            }
        }
    }

    public void orderByTaskExeTag(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by task_exe_tag asc";
            }else{
                this.orderStr = this.orderStr + ",task_exe_tag asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by task_exe_tag desc";
            }else{
                this.orderStr = this.orderStr + ",task_exe_tag desc";
            }
        }
    }

    public void orderByExeCount(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by exe_count asc";
            }else{
                this.orderStr = this.orderStr + ",exe_count asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by exe_count desc";
            }else{
                this.orderStr = this.orderStr + ",exe_count desc";
            }
        }
    }

    public void orderByMaxExeCount(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by max_exe_count asc";
            }else{
                this.orderStr = this.orderStr + ",max_exe_count asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by max_exe_count desc";
            }else{
                this.orderStr = this.orderStr + ",max_exe_count desc";
            }
        }
    }

    public void orderByCreateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by create_time asc";
            }else{
                this.orderStr = this.orderStr + ",create_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by create_time desc";
            }else{
                this.orderStr = this.orderStr + ",create_time desc";
            }
        }
    }

    public void orderByLastUpdateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by last_update_time asc";
            }else{
                this.orderStr = this.orderStr + ",last_update_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by last_update_time desc";
            }else{
                this.orderStr = this.orderStr + ",last_update_time desc";
            }
        }
    }

    public void orderByExtend1(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend1 asc";
            }else{
                this.orderStr = this.orderStr + ",extend1 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend1 desc";
            }else{
                this.orderStr = this.orderStr + ",extend1 desc";
            }
        }
    }

    public void orderByExtend2(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend2 asc";
            }else{
                this.orderStr = this.orderStr + ",extend2 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend2 desc";
            }else{
                this.orderStr = this.orderStr + ",extend2 desc";
            }
        }
    }

    public void orderByExtend3(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend3 asc";
            }else{
                this.orderStr = this.orderStr + ",extend3 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend3 desc";
            }else{
                this.orderStr = this.orderStr + ",extend3 desc";
            }
        }
    }

    public void orderByExtend4(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend4 asc";
            }else{
                this.orderStr = this.orderStr + ",extend4 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend4 desc";
            }else{
                this.orderStr = this.orderStr + ",extend4 desc";
            }
        }
    }

    public void orderByExtend5(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend5 asc";
            }else{
                this.orderStr = this.orderStr + ",extend5 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend5 desc";
            }else{
                this.orderStr = this.orderStr + ",extend5 desc";
            }
        }
    }
}